{extend name='base@layout/base' /}
{block name='title'}修改密码{/block}
{block name='pageTitle'}
<div class="page-title">
    <div class="breadcrumb-env pull-left">
        <ol class="breadcrumb bc-1">
            <li>
                <a href="{:url('/base/Index/index')}"><i class="fa-home"></i>首页</a>
            </li>
            <li>
                <a href="javascript:;">基本设置</a>
            </li>
            <li class="active">
                <strong>修改密码</strong>
            </li>
        </ol>
    </div>
</div>
{/block}
{block name='content'}
<form method="post" class="validate edit_from" novalidate="novalidate">

    <div class="row">
        <div class="col-md-3">
            <div class="form-group">
                <label for="password" class="control-label">用户原密码</label>
                <input type="text" id="password" class="form-control" name="password" placeholder="用户原密码">
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-3">
            <div class="form-group">
                <label for="newpwd" class="control-label">用户新密码</label>
                <input type="text" id="newpwd" class="form-control" name="newpwd" placeholder="用户新密码">
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-3">
            <div class="form-group">
                <label for="confirmpwd" class="control-label">用户确认密码</label>
                <input type="text" id="confirmpwd" class="form-control" name="confirmpwd" placeholder="用户确认密码">
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-3">
            <div class="form-group">
                <button type="reset" class="btn btn-white">取消</button>
                <button type="button" class="btn btn-info" id="btn_post">确定</button>
            </div>
        </div>
    </div>

</form>
<script>
    $(function () {
        $('#btn_post').click(function () {
            var res = $(".edit_from").serializeArray();

            $.post("{:url('/system/sign/pwreset')}", res,function(data){
                if( data.error>0 ){
                    toastr.error( data.msg );
                }else{
                    toastr.success( data.msg );
                    window.location.href = "{:url('/system/sign/logout')}";
                }
            }, "json");
        });
    });

</script>
{/block}
